package weaver.interfaces.expense.action.gzc.th;

import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.Util;

/**
 * 
 * @ClassName: GZC_TH_Expense 
 * @Description: 国资处费用预算退回
 * @author xiyufei
 * @date 2017-3-20 上午11:19:21 
 *
 */
public class GZC_TH_Expense extends BaseBean{

		public String thExpense(String workflowid,String requestid,String nodeid){
			writeLog("开始进入流程退回！=============GZC_TH_Expense"+"wfif:"+workflowid+"reqid:"+requestid+"nodeid:"+nodeid);
			RecordSet rs = new RecordSet();
			BaseBean bb = new BaseBean();
			String yqsbgzhwfid = Util.null2String(bb.getPropValue("expense", "yqsbgzhwfid"));
			String jjgzhwfid = Util.null2String(bb.getPropValue("expense", "jjgzhwfid"));
			String wxplywfid = Util.null2String(bb.getPropValue("expense", "wxplywfid"));
			String yzdhxplywfid = Util.null2String(bb.getPropValue("expense", "yzdhxplywfid"));
			String cysjgzwfid = Util.null2String(bb.getPropValue("expense", "cysjgzwfid"));
			String sjhcgzhwfid = Util.null2String(bb.getPropValue("expense", "sjhcgzhwfid"));
			String yskfwzlywfid = Util.null2String(bb.getPropValue("expense", "yskfwzlywfid"));
			String yskfwzlyzdswfid = Util.null2String(bb.getPropValue("expense", "yskfwzlyzdswfid"));
			String zcpzwfid = Util.null2String(bb.getPropValue("expense", "zcpzwfid"));
			String zcpzclfwfid = Util.null2String(bb.getPropValue("expense", "zcpzclfwfid"));
			String zcpzsjhcwfid = Util.null2String(bb.getPropValue("expense", "zcpzsjhcwfid"));

			String kysjcgsqwfid = Util.null2String(bb.getPropValue("expense", "kysjcgsqwfid"));
			
			rs.execute("select nodeid from workflow_flownode where nodetype=0 and workflowid="+ workflowid);
			rs.next();
			String onodeid = Util.getIntValue(rs.getString("nodeid"), 0)+"";
			if(!nodeid.equals(onodeid)){
				return null;
			}
			if(workflowid.equals(yqsbgzhwfid)){// 仪器设备购置费用预算退回
				QYSBGZ_TH_ExpenseAction qysbgz_TH_ExpenseAction = new QYSBGZ_TH_ExpenseAction();
				qysbgz_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(jjgzhwfid)){//家具购置申请表
				JJGZ_TH_ExpenseAction  jjgz_TH_ExpenseAction = new JJGZ_TH_ExpenseAction();
				jjgz_TH_ExpenseAction.execute(workflowid, requestid);
			} 
			if(workflowid.equals(wxplywfid)){//危险品领用表 
				WXPLY_TH_ExpenseAction  wxply_TH_ExpenseAction = new WXPLY_TH_ExpenseAction();
				wxply_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(yzdhxplywfid)){//4.易制毒（爆）化学品领用表
				YZDBHXPLY_TH_ExpenseAction  yzdbhxply_TH_ExpenseAction = new YZDBHXPLY_TH_ExpenseAction();
				yzdbhxply_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(cysjgzwfid)){//5.常用试剂申购单
				CYSJSG_TH_ExpenseAction  cysjsg_TH_ExpenseAction = new CYSJSG_TH_ExpenseAction();
				cysjsg_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(sjhcgzhwfid)){//试剂耗材购置申请表费用预算退回
				SJHCGZSQ_TH_ExpenseAction sjhcgzsq_TH_ExpenseAction = new SJHCGZSQ_TH_ExpenseAction();
				sjhcgzsq_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(yskfwzlywfid)){//院所库房物资领用单
				YSKFWZLY_TH_ExpenseAction yskfwzly_TH_ExpenseAction = new YSKFWZLY_TH_ExpenseAction();
				yskfwzly_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(yskfwzlyzdswfid)){//院所库房物资领用单-重点室
				YSKFWZLYZDS_TH_ExpenseAction yskfwzlyzds_TH_ExpenseAction = new YSKFWZLYZDS_TH_ExpenseAction();
				yskfwzlyzds_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(zcpzwfid)){//支出凭证
				ZCPZ_TH_ExpenseAction zcpz_TH_ExpenseAction = new ZCPZ_TH_ExpenseAction();
				zcpz_TH_ExpenseAction.execute(workflowid, requestid);
			}
			if(workflowid.equals(kysjcgsqwfid)){//科研试剂采购申请
				KYSJCGSQ_TH_ExpenseAction kysjcgsq_TH_ExpenseAction = new KYSJCGSQ_TH_ExpenseAction();
				kysjcgsq_TH_ExpenseAction.execute(workflowid, requestid);
			}

			if(workflowid.equals(zcpzclfwfid)){//支出凭证-差旅费
				ZCPZ_TH_ExpenseAction zcpz_TH_ExpenseAction = new ZCPZ_TH_ExpenseAction();
				zcpz_TH_ExpenseAction.executeCLF(workflowid, requestid);
			}
			if(workflowid.equals(zcpzsjhcwfid)){//支出凭证-试剂耗材
				ZCPZ_CLF_TH_ExpenseAction zcpz_CLF_TH_ExpenseAction = new ZCPZ_CLF_TH_ExpenseAction();
				zcpz_CLF_TH_ExpenseAction.execute(workflowid, requestid);
			}
			return null;
		}
 
}
